<?php
/*
for($i = 0; $i < 64;$i++) {
	echo "                                        *out++ = (*cur & 0x".dechex(1<<$i).") >> {$i};\n";
}
for($i = 0; $i < 32;$i++) {
	echo "                                        *out++ = (*cur & 0x".dechex(bindec("11")<<$i*2).") >> ".($i*2).";\n";
}

for($i = 0; $i < 16;$i++) {
	echo "                                        *out++ = (*cur & 0x".dechex(bindec("1111")<<$i*4).") >> ".($i*4).";\n";
}
*/

//$bs = array(10, 10, 10 ,10, 12, 12);
$bss[] = array(12, 12, 12, 14, 14);
$bss[] = array(16, 16, 16, 16);
$bss[] = array(20, 22, 22);
$bss[] = array(20, 24, 20);
$bss[] = array(16, 48);
$bss[] = array(48, 16);
$bss[] = array(32, 32);
$bss[] = array(64);

foreach($bss as $bs) {
	$bits = 0;
	for($i = 0; $i < count($bs);$i++) {

		echo "                                        *out++ = (*cur & 0x".dechex(bindec(str_repeat("1",$bs[$i]))<<$bits).") >> ".($bits).";\n";
		$bits += $bs[$i];
	}
	echo str_repeat('=', 80), "\n";
}
